package com.leon.lifeenginespace.spring;

import java.util.Objects;

/**
 * @description: TODO
 * @author: WT
 * @date: 2024/4/15 0:38
 * @Version 1.0
 **/

public final class Resource {
    private final String path;
    private final String name;

    Resource(String path, String name) {
        this.path = path;
        this.name = name;
    }

    public String path() {
        return path;
    }

    public String name() {
        return name;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this) return true;
        if (obj == null || obj.getClass() != this.getClass()) return false;
        Resource that = (Resource) obj;
        return Objects.equals(this.path, that.path) &&
                Objects.equals(this.name, that.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(path, name);
    }

    @Override
    public String toString() {
        return "Resource[" +
                "path=" + path + ", " +
                "name=" + name + ']';
    }


}